from flask import Blueprint, request
from app.models import Doctor
from app.utils import custom_jsonify

doctor_bp = Blueprint('doctor', __name__)

@doctor_bp.route('/doctor', methods=['GET'])
def get_doctor_info_by_name():
    doctor_name = request.args.get('name')
    doctor_name = "阎嘉伦"
    doctor = Doctor.query.filter_by(doctor_name=doctor_name).first()
    if doctor:
        return custom_jsonify({
            "doctor_id": doctor.doctor_id,
            "doctor_name": doctor.doctor_name
        }, 200)
    return custom_jsonify({"message": "医生未找到"}, 404)
